package wk.asm.test.visitor;

import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;

/**
 * Created by wangkuan at 2018-09-04 9:09
 */
public class MyMethodVisitor extends MethodVisitor {

    public MyMethodVisitor(int version, MethodVisitor mv) {
        super(version, mv);
    }

    @Override
    public void visitCode() {
        //发现只有目标方法为静态方法时，可以找到目标方法；而需要实例来调用的方法时，不知道如何使用
        visitMethodInsn(Opcodes.INVOKESTATIC, "wk/asm/test/TesterEnhancer", "enhance", "()V", false);
    }

}
